//
//  gobangViewController.m
//  gobang
//
//  Created by huangyu on 11-6-12.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "gobangViewController.h"
@implementation gobangViewController

@synthesize chessboardView;

- (void)dealloc
{
    [chessboardView release];
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
    ChessboardView *chessboard = [[ChessboardView alloc] initWithFrame:CGRectMake(0, 0, 320, 416)];
    [self.view addSubview:chessboard];
    self.chessboardView = chessboard;
    [chessboard release];

}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)playChessAgain:(id)sender{
    
    [self.chessboardView restartChess];
    
}

@end
